﻿@using SapaFinance.DTO
@using SapaFinance.UI.Controllers
@using Microsoft.Web.Mvc
@model AccountDTO
<fieldset>
    <legend>Карточка нового банк. счета</legend>
    @Html.HiddenFor(c => c.UID)
    @{
        if (@Model.UID != Guid.Empty)
        {
            Html.RenderPartial("EditorTemplates/ChangableDTO", @Model);
        }
    }
    <div class="display-label">@Html.LabelFor(m => @Model.AccountNumber)</div>
    <div class="editor-field">@Html.EditorFor(m => @Model.AccountNumber)</div>
    <div class="display-label">@Html.LabelFor(m => @Model.Iban)</div>
    <div class="editor-field">@Html.EditorFor(m => @Model.Iban)</div>
    <div class="display-label">@Html.LabelFor(m => @Model.IsHidden)</div>
    <div class="editor-field">@Html.EditorFor(m => @Model.IsHidden)</div>
    <div class="display-label">@Html.LabelFor(m => @Model.IsPrimaryAccount)</div>
    <div class="editor-field">@Html.EditorFor(m => @Model.IsPrimaryAccount)</div>
    <div class="display-label">@Html.LabelFor(m => @Model.SelectedBank)</div>
    @{ Html.RenderAction<BankController>(x => x.RenderBank(@Model.SelectedBank)); }
    <div class="display-label">@Html.ValidationMessageFor(m => @Model.SelectedBank)</div>
    <div class="display-label">@Html.LabelFor(m => @Model.SelectedCorporation)</div>
    @{ Html.RenderAction<CorporationController>(x => x.RenderCorporation(@Model.SelectedCorporation)); }
    <div class="display-label">@Html.ValidationMessageFor(m => @Model.SelectedCorporation)</div>
    <div class="display-label">@Html.LabelFor(m => @Model.SelectedCurrency)</div>
    @{ Html.RenderAction<CurrencyController>(x => x.RenderCurrency(@Model.SelectedCurrency)); }
    <div class="display-label">@Html.ValidationMessageFor(m => @Model.SelectedCurrency)</div>
        <div class="display-label">@Html.LabelFor(m => @Model.SelectedOwner)</div>
    @{ Html.RenderAction<UserController>(x => x.RenderOwners(@Model.SelectedOwner)); }
    <div class="display-label">@Html.ValidationMessageFor(m => @Model.SelectedOwner)</div>

</fieldset>
